package guice.boot.archive.spi.model;


public enum BizState {
    UNRESOLVED("unresolved"), //
    RESOLVED("resolved"),//
    ACTIVATED("activated"),//
    DEACTIVATED("deactivated"),//
    BROKEN("broken");//

    private String state;

    BizState(String state) {
        this.state = state;
    }

    public static BizState of(String state) {
        if (UNRESOLVED.name().equalsIgnoreCase(state)) {
            return UNRESOLVED;
        } else if (RESOLVED.name().equalsIgnoreCase(state)) {
            return RESOLVED;
        } else if (ACTIVATED.name().equalsIgnoreCase(state)) {
            return ACTIVATED;
        } else if (DEACTIVATED.name().equalsIgnoreCase(state)) {
            return DEACTIVATED;
        } else {
            return BROKEN;
        }
    }

    public String getBizState() {
        return state;
    }

    @Override
    public String toString() {
        return getBizState();
    }
}